1. Field of the Invention
This invention generally relates to database systems, and more specifically relates to an apparatus and method for optimizing database queries.
2. Background Art
Database systems have been developed that allow a computer to store a large amount of information in a way that allows a user to search for and retrieve specific information in the database. For example, an insurance company may have a database that includes all of its policy holders and their current account information, including payment history, premium amount, policy number, policy type, exclusions to coverage, etc. A database system allows the insurance company to retrieve the account information for a single policy holder among the thousands and perhaps millions of policy holders in its database.
Retrieval of information from a database is typically done using queries. A query usually specifies conditions that apply to one or more columns of the database, and may specify relatively complex logical operations on multiple columns. The database is searched for records that satisfy the query, and those records are returned as the query result.
Queries are typically optimized by generating an access plan that will speed their execution. The work required to generate an access plan is greatly increased for a query to a partitioned database table, where multiple partitions are defined that collectively make up the overall database table. Sometimes the increased work for optimizing a query to a partitioned database table negates the desired performance enhancement that drove the partitioning of the database in the first place. Without a way to improve the efficiency of queries to partitioned database tables, existing database systems will suffer from reduced performance when optimizing queries to partitioned database tables.